home *** CD-ROM | disk | FTP | other *** search
/ SGI Enlighten DSM 1.1 / SGI EnlightenDSM 1.1.iso / doc / adobe.tar / Browsers / netscape
Text File  |  1997-06-13  |  5KB  |  200 lines

  1. #!/bin/sh
  2. #
  3. # Copyright (c) 1996, Adobe Systems Incorporated
  4. # All Rights Reserved
  5. #
  6. # This is an example script to show you how to launch Netscape (TM) with
  7. # Acrobat 3.0 integration.  If the script is run unmodified, it will
  8. # query the user for: 1). the installation directory for Acrobat 3.0 and
  9. # 2). the installation directory for Netscape v3.0.  You may modify the
  10. # script where indicated to identify the proper directories.
  11. #
  12.  
  13. #
  14. # Initialization
  15. #
  16. osname=`uname -s`
  17. osrelease=`uname -r`
  18. args="$@"
  19.  
  20. echoawk ()
  21. {
  22.   echo $* | awk '{ printf "%s", $0 }'
  23. }
  24.  
  25. echon ()
  26. {
  27.   echo -n "$*"
  28. }
  29.  
  30. echoc ()
  31. {
  32.   echo "${*}\c"
  33. }
  34.  
  35. if [ `echo "x\c"` = "x" ] ; then
  36.   echonl=echoc
  37. else
  38.   echonl=echon
  39. fi
  40.  
  41. ndefault="/usr/local/Netscape3"
  42. adefault="/usr/local/Acrobat3"
  43. case "$osname" in
  44.   SunOS)
  45.     case "$osrelease" in
  46.       4.1.[34]*)
  47.         adefault="/usr/Acrobat3"
  48.         ;;
  49.       5.*)
  50.         adefault="/opt/Acrobat3"
  51.         ;;
  52.     esac
  53.     ;;
  54.   IRIX)
  55.     adefault="/opt/Acrobat3"
  56.     ;;
  57.   HP-UX)
  58.     case "$osrelease" in
  59.       *.09.*)
  60.         adefault="/usr/local/Acrobat3"
  61.         ;;
  62.       *.10.*)
  63.         adefault="/opt/Acrobat3"
  64.         ;;
  65.       esac
  66.     ;;
  67.   Linux)
  68.     adefault="/usr/local/Acrobat3"
  69.     ;;
  70. esac
  71.  
  72. #
  73. # The Shell variable "adir" identifies the Acrobat 3.0 installation
  74. # directory.  If the value of "$adir" is zero length, the user will
  75. # be prompted to enter the installation directory for Acrobat 3.0
  76. # The correct directory for Acrobat may be added after the equals
  77. # sign on the line below.
  78. #
  79. adir=
  80.  
  81. #
  82. # The Shell variable "ndir" identifies the Netscape 3.0 installation
  83. # directory.  If the value of "$ndir" is zero length, the user will
  84. # be prompted to enter the installation directory for Netscape 3.0.
  85. # The correct directory for Netscape may be added after the equals
  86. # sign on the line below.
  87. #
  88. ndir=
  89.  
  90. #
  91. # The following lines are fairly generic and should not require
  92. # any modification. They just test to see if the Acrobat installation
  93. # directory is somewhat valid.
  94. #
  95. while [ -z "$adir" ] ; do
  96.   $echonl "Enter the directory containing Acrobat 3.0 [$adefault] "
  97.   read answer
  98.   if [ -z "$answer" ] ; then
  99.     adir="$adefault"
  100.   else
  101.     adir="$answer"
  102.   fi
  103. done
  104. if [ ! -d "$adir" ] ; then
  105.   echo " "
  106.   echo "The installation directory:"
  107.   echo " "
  108.   echo "$adir"
  109.   echo " "
  110.   echo "is not a valid Acrobat 3.0 installation.  You will not"
  111.   echo "be able to view embedded PDF's and view PDF's in Netscape."
  112.   echo "Please consult a system administrator at your site to get the"
  113.   echo "pathname to the Acrobat 3.0 installation."
  114.   echo " "
  115. fi
  116.  
  117. while [ -z "$ndir" ] ; do
  118.   $echonl "Enter the directory containing Netscape 3.0 [$ndefault] "
  119.   read answer
  120.   if [ -z "$answer" ] ; then
  121.     ndir="$ndefault"
  122.   else
  123.     ndir="$answer"
  124.   fi
  125. done
  126.  
  127. case "$osname" in
  128.   SunOS)
  129.     case "$osrelease" in
  130.       4.1.[34]*)
  131.         pconfig=sparcsun
  132.         XNLSPATH="$ndir"/nls
  133.         export XNLSPATH
  134.         ;;
  135.       5.3*) pconfig=sparcsolaris ;;
  136.       5.[45]*) pconfig=sparcsolaris ;;
  137.     esac
  138.     ;;
  139.   HP-UX) pconfig=hppahpux ;;
  140.   IRIX)
  141.     pconfig=mipsirix
  142.     ;;
  143.   Linux)
  144.     pconfig=intellinux
  145.     ;;
  146. esac
  147.  
  148. #
  149. # Point Netscape to its Keysym Database.  This is recommended practice.
  150. #
  151. XKEYSYMDB="$ndir"/XKeysymDB
  152. export XKEYSYMDB
  153.  
  154. #
  155. # This points Netscape to the Acrobat viewer plug-in so that PDF's
  156. # may be viewed inside of the Netscape window.
  157. #
  158. NPX_PLUGIN_PATH="$adir"/Browsers/$pconfig
  159. export NPX_PLUGIN_PATH
  160.  
  161. #
  162. # We must make sure that the Acrobat Reader and/or Exchange are on
  163. # the execution search path.  The Acrobat plug-in for Netscape tries
  164. # to execute the correct version of Acrobat.
  165. #
  166. PATH="$adir"/bin:$PATH
  167. export PATH
  168.  
  169. #
  170. # Netscape needs to have its current resources so let's set them here.
  171. #
  172. XENVIRONMENT="$ndir"/Netscape.ad
  173. export XENVIRONMENT
  174.  
  175. #
  176. # Now to launch Netscape.  We take a look to see if the directory exists
  177. # and if the file called "netscape" inside of the directory is executable.
  178. # If neither condition is true, then we blurt out a short error message.
  179. #
  180. if [ -d "$ndir" ] ; then
  181.   if [ -x "$ndir"/netscape ] ; then
  182.     exec "$ndir"/netscape ${netscape_args} $args
  183.   else
  184.     echo " "
  185.     echo "$ndir/netscape either does not exist or is not executable."
  186.     echo "Please consult a system administrator for the correct path"
  187.     echo "to the Netscape browser installation."
  188.     echo " "
  189.   fi
  190. else
  191.   echo " "
  192.   echo "$ndir either does not exist or is not a directory."
  193.   echo "Please consult a system administrator for the corret path"
  194.   echo "to the Netscape browser installation."
  195.   echo " "
  196. fi
  197.  
  198. exit 1
  199.  
  200.